# 模板jinja2

from flask import Flask,render_template

app = Flask(__name__)

data = {
    'name': '张',
    'age': 18,
    'mylist':[1,2,3,12333,231,23,231,23]
        }

@app.route('/index' )
def index():
    return render_template('index2.html',data=data)

li = [1,1,4,87,54,4]
def list_step(li):
    return li[::2]

#注册过滤器
app.add_template_filter(list_step,'li2')


if __name__ == '__main__':
    app.run()